/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 隐藏 GoJS 水印 */
canvas + div[style*="position: absolute"] {
    display: none !important;
}

/* 或者更精确的选择器 */
div[style*="font-family: sans-serif"][style*="font-size: 9px"] {
    display: none !important;
}

/* GoJS 水印隐藏 - 通用方法 */
.go-watermark,
div[style*="GoJS"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    
    --font-family: 'Inter', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* 顶部导航栏 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 24px;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

/* 主要内容区域 */
.main-container {
    padding: 24px;
    min-height: calc(100vh - 64px - 60px);
}

.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    gap: 24px;
    height: calc(100vh - 148px);
}

/* 面板通用样式 */
.input-panel,
.diagram-panel {
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.input-panel {
    flex: 0 0 400px;
}

.diagram-panel {
    flex: 1;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.panel-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
}

.panel-header i {
    color: var(--primary-color);
}

.panel-actions {
    display: flex;
    gap: 8px;
}

/* 按钮样式 */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--border-radius);
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 输入区域 */
.input-section {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#inputText {
    flex: 1;
    padding: 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    font-size: 14px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    resize: none;
    outline: none;
    transition: all 0.2s ease;
    line-height: 1.6;
    background: var(--gray-50);
}

#inputText:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.char-count {
    font-size: 12px;
    color: var(--gray-500);
}

/* 使用说明 */
.instructions {
    padding: 24px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.instructions h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.instruction-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--gray-600);
}

.instruction-item i {
    width: 16px;
    color: var(--primary-color);
    font-size: 12px;
}

/* 图表区域 */
.diagram-wrapper {
    flex: 1;
    position: relative;
    background: var(--gray-50);
}

#myDiagramDiv {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 0 0 var(--border-radius-xl) var(--border-radius-xl);
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--gray-400);
    z-index: 1;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-600);
}

.empty-state p {
    font-size: 14px;
    max-width: 300px;
}

/* 底部状态栏 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--gray-200);
    height: 60px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.status-info {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: var(--gray-600);
}

.footer-text {
    font-size: 12px;
    color: var(--gray-500);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        height: auto;
        gap: 16px;
    }
    
    .input-panel {
        flex: none;
        height: 400px;
    }
    
    .diagram-panel {
        flex: none;
        height: 500px;
    }
    
    .main-container {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
    }
    
    .nav {
        display: none;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .panel-header {
        padding: 16px 20px;
    }
    
    .input-section {
        padding: 20px;
    }
    
    .instructions {
        padding: 20px;
    }
}

/* 滚动条样式 */
#inputText::-webkit-scrollbar {
    width: 6px;
}

#inputText::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

#inputText::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

#inputText::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-panel,
.diagram-panel {
    animation: fadeIn 0.5s ease-out;
}

/* 加载状态 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}